/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.assignment2.openclose.impl;

import za.ac.cput.assignment2.openclose.AccountOCPInterface;

/**
 *
 * @author yandiswa
 */
public class AccountOCPImpl implements AccountOCPInterface {
    private int accNum;
    
    private double accBalance;
public AccountOCPImpl()
{}
    public AccountOCPImpl(int num,double bal){
        accNum = num;
       
        accBalance = bal;
    }

    public int getAccNumber(){
        return accNum;
    }
   
    public double getAccBalance(){
        return accBalance;
    }

    public void deposit(double cash) {  // this obeys the Open/Closed Principle
        accBalance += cash;
    }

    public void deposit(double cash, double charges){   // extending the application using a derivative of the abstract method deposit(...)
        accBalance += (cash - charges);
    }
    
}
